package com.lcf.app.swagger.controller;

import com.lcf.app.swagger.model.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

/**
 * @author ChenFei
 * @date 2021/11/3
 */
@Api(tags = "管理员管理接口")
@RestController
@RequestMapping("admin")
public class AdminController {

    @ApiOperation("查询")
    @GetMapping("/{id}")
    public User getUser(@ApiParam("用户ID") @PathVariable("id") String id) {
        return new User();
    }

    @ApiOperation(value = "添加", hidden = true)
    @PostMapping("/")
    public Boolean save(@RequestBody User user) {
        return true;
    }

    @ApiOperation(value = "编辑")
    @PutMapping("/")
    public Boolean update(@RequestBody User user) {
        return true;
    }

    @ApiOperation("删除")
    @DeleteMapping("/{id}")
    public Boolean remove(@ApiParam("用户ID") @PathVariable("id") String id) {
        return true;
    }

}
